<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>JSP - Hello World</title>
</head>
<body>
<c:choose>
    <c:when test="${sessionScope.user eq null}">

<form action="/user/signIn" method="post">
    <input type="text" name="username" placeholder="USERNAME" value="user-">
    <br>
    <input type="password" name="password" placeholder="PASSWORD" value="123">
    <br>
    <input type="submit" value="sign in">
</form>

    </c:when>
    <c:otherwise>
        <a href="/user/signOut"> sign out</a>
    </c:otherwise>

<a href="signUp.jsp">sign up</a>
</c:choose>
<h1 style="color:red;">
    ${requestScope.error}
</h1>
<h1>
    ${sessionScope.id}
</h1>
<ol>
   <c:forEach var="articles" items="${sessionScope.articles}">
       <li><a href="/article/queryArticleById/${articles.id}"/>${articles.title}</li>
   </c:forEach>
</ol>
<h1 style="color:red;">
    ${requestScope.error}
</h1>
</body>
</html>